import React from "react";
import { Text, ScrollView, View, Alert } from "react-native";
import { Card, WhiteSpace, List } from "@ant-design/react-native";
const Item = List.Item;
const Brief = Item.Brief;

export default class LterMap extends React.Component {
  render() {
    let lterArray = new Array();
    for (var key in this.props.lter_map) {
      this.props.lter_map[key].addr = key;
      lterArray.push(this.props.lter_map[key]);
    }

    return lterArray.map((lter, key) => {
      return (
        <View key={key}>
          <WhiteSpace size="lg" />
          <Card full>
            <Card.Header
              title={lter.addr.split(":")[0]}
              thumbStyle={{ width: 30, height: 30 }}
              thumb="https://gw.alipayobjects.com/zos/rmsportal/MRhHctKOineMbKAZslML.jpg"
              extra="在线"
            />
            <Card.Footer content="设备端口" extra={lter.addr.split(":")[1]} />
            <Card.Footer content="地理位置" extra={lter.ip_region} />
            <Card.Footer content="上线时间" extra={lter.on_time} />
            <Card.Footer content="上报总量" extra={lter.pcap_num} />
          </Card>
        </View>
      );
    });
  }
}
